﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Logs.Controller;

namespace Pixysoft.Framework.Logs.Core
{
    class LogDocumentSummary : ILogDocumentSummary
    {
        DateTime timeFrom = DateTime.MaxValue;

        DateTime timeTo = DateTime.MinValue;

        int recordCount = 0;

        int countOfFatal = 0;

        int countOfError = 0;

        int countOfWarning = 0;

        int countOfInfo = 0;

        int countOfDebug = 0;

        #region ILogDocumentSummary 成员

        public DateTime TimeFrom
        {
            get
            {
                return timeFrom;
            }
            internal set { timeFrom = value; }
        }

        public DateTime TimeTo
        {
            get
            {
                return timeTo;
            }
            internal set { timeTo = value; }
        }

        public int RecordCount
        {
            get
            {
                return recordCount;
            }
            internal set { recordCount = value; }
        }

        public int CountOfFatal
        {
            get
            {
                return countOfFatal;
            }
            internal set { countOfFatal = value; }
        }

        public int CountOfError
        {
            get
            {
                return countOfError;
            }
            internal set { countOfError = value; }
        }

        public int CountOfWarn
        {
            get
            {
                return countOfWarning;
            }
            internal set { countOfWarning = value; }
        }

        public int CountOfInfo
        {
            get
            {
                return countOfInfo;
            }
            internal set { countOfInfo = value; }
        }

        public int CountOfDebug
        {
            get
            {
                return countOfDebug;
            }
            internal set { countOfDebug = value; }
        }

        public string RawSerialize()
        {
            return LogNonStructureSerializeController.Instance.Serialize(this);
        }

        #endregion
    }
}
